﻿<UserControl x:Class="Tisbi.LawFirm.UI.Views.Controls.Forms.LawsuitCRUDForm"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:bl="clr-namespace:Tisbi.LawFirm.BL;assembly=Tisbi.LawFirm.BL"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:controls="clr-namespace:Tisbi.LawFirm.UI.Views.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800">
    <Grid Style="{StaticResource ContentRoot}">
        <TabControl>
            <TabItem Header="Информация по иску">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition MinWidth="380" Width="50*" />
                        <ColumnDefinition MinWidth="380" Width="50*" />
                    </Grid.ColumnDefinitions>

                    <Grid.Resources>
                        <Style TargetType="StackPanel">
                            <Setter Property="Orientation" Value="Horizontal" />
                            <Setter Property="Margin" Value="0,0,0,4" />
                        </Style>
                    </Grid.Resources>

                    <ScrollViewer Margin="10" Grid.Column="0">
                        <StackPanel Orientation="Vertical">
                            <StackPanel>
                                <Label Content="id:" Target="{Binding ElementName=TextUuid}"/>
                                <TextBox x:Name="TextUuid" Text="{Binding Path=Model.Id}" IsReadOnly="True" Background="LightGray"/>
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Номер:" />
                                <TextBox Text="{Binding Path=Number, Mode=TwoWay, ValidatesOnDataErrors=True}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Дата создания:" />
                                <TextBox IsReadOnly="True" Background="LightGray" Text="{Binding Path=Model.Created, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Тип иска:" />
                                <ComboBox ItemsSource="{Binding Path=CourtTypes}"
                                    SelectedItem="{Binding Path=SelectedCourtType, Mode=TwoWay}"
                                    DisplayMemberPath="CourtTypeTitle" />
                                <mui:ModernButton Command="{Binding SelectCourtTypes}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новый тип иска" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Федеральный округ:" />
                                <ComboBox ItemsSource="{Binding Path=Districts}"
                                    SelectedItem="{Binding Path=SelectedDistrict, Mode=TwoWay}" 
                                    DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectDistricts}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новый федеральный округ" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Истец:" />
                                <ComboBox ItemsSource="{Binding Path=Plaintiffs}" SelectedItem="{Binding Path=SelectedPlaintiff, Mode=TwoWay}" DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectPlaintiffs}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новое лицо" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Ответчик:" />
                                <ComboBox ItemsSource="{Binding Path=Defendants}" SelectedItem="{Binding Path=SelectedDefendant, Mode=TwoWay}" DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectDefendants}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новое лицо" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Третьи лица:" />
                                <ComboBox ItemsSource="{Binding Path=ThirdParties}" SelectedItem="{Binding Path=SelectedThirdParties, Mode=TwoWay}" DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectThirdParties}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новое лицо" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Вид искового заявления:" />
                                <ComboBox ItemsSource="{Binding Path=StatementOfClaimTypes}" SelectedItem="{Binding Path=SelectedStatementOfClaimType, Mode=TwoWay}" DisplayMemberPath="StatementOfClaimTypeTitle" />
                                <mui:ModernButton Command="{Binding SelectStatementOfClaimTypes}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новый вид искового заявления" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Содержание требований:" />
                                <TextBox MinLines="4" Text="{Binding Path=Model.ContentRequirements, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Сумма основного долга:" />
                                <TextBox Text="{Binding Path=Model.PrincipalDebt, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Сумма пени:" />
                                <TextBox Text="{Binding Path=Model.LatePaymentCharge, Mode=TwoWay}" />
                            </StackPanel>
                        </StackPanel>
                    </ScrollViewer>

                    <ScrollViewer Margin="10" Grid.Column="1">
                        <StackPanel Orientation="Vertical">
                            <StackPanel>
                                <Label Content="Сумма иска:" />
                                <TextBox Text="{Binding Path=Model.ClaimAmount, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Госпошлина:" />
                                <TextBox Text="{Binding Path=Model.NationalDuty, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Решение:" />
                                <ComboBox ItemsSource="{Binding Path=Outcomes}" SelectedItem="{Binding Path=SelectedOutcome, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Сумма выплаты:" />
                                <TextBox Text="{Binding Path=Model.OutcomeAmount, Mode=TwoWay}" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Суд:" />
                                <ComboBox ItemsSource="{Binding Path=Courts}" SelectedItem="{Binding Path=SelectedCourts, Mode=TwoWay}" DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectCourts}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новый суд" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Номер дела в суде:"  />
                                <TextBox Text="{Binding Path=Model.CourtCaseNumber, Mode=TwoWay}"  />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Контакты судьи:"  />
                                <TextBox Text="{Binding Path=Model.ContactsOfJudge, Mode=TwoWay}"  />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Дата слушания:"  />
                                <DatePicker>
                                    <DatePicker.Text>
                                        <Binding Path="SelectedHearingDate" Mode="TwoWay">
                                            <Binding.Converter>
                                                <bl:DateConverter />
                                            </Binding.Converter>
                                        </Binding>
                                    </DatePicker.Text>
                                </DatePicker>
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Место нахождения дела:" />
                                <ComboBox ItemsSource="{Binding Path=LocationCaseMaterials}" SelectedItem="{Binding Path=SelectedLocationCaseMaterials, Mode=TwoWay}" DisplayMemberPath="Title" />
                                <mui:ModernButton Command="{Binding SelectLocationCaseMaterials}" EllipseDiameter="26" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="14" IconHeight="14" ToolTip="Добавить новый суд" IconData="{StaticResource AddIconData}" Width="28" />
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Дата решения:"  />
                                <DatePicker>
                                    <DatePicker.Text>
                                        <Binding Path="SelectedDateOfDecision" Mode="TwoWay">
                                            <Binding.Converter>
                                                <bl:DateConverter />
                                            </Binding.Converter>
                                        </Binding>
                                    </DatePicker.Text>
                                </DatePicker>
                            </StackPanel>
                            <StackPanel>
                                <Label Content="Содержание решения:" />
                                <TextBox MinLines="4" Text="{Binding Path=Model.ResultOfDecision, Mode=TwoWay}" />
                            </StackPanel>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <TabItem Header="Апеляции">
                <controls:AppealsGreed></controls:AppealsGreed>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>
